package top.zywork.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.zywork.dao.GoodsCategoryBrandDAO;
import top.zywork.dos.GoodsCategoryBrandDO;
import top.zywork.dto.GoodsCategoryBrandDTO;
import top.zywork.service.AbstractBaseService;
import top.zywork.service.GoodsCategoryBrandService;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * GoodsCategoryBrandServiceImpl服务接口实现类<br/>
 *
 * 创建于2019-08-22<br/>
 *
 * @author http://zywork.top 王振宇
 * @version 1.0
 */
@Service(value = "goodsCategoryBrandService")
public class GoodsCategoryBrandServiceImpl extends AbstractBaseService implements GoodsCategoryBrandService {

    private GoodsCategoryBrandDAO goodsCategoryBrandDAO;

    @Autowired
    public void setGoodsCategoryBrandDAO(GoodsCategoryBrandDAO goodsCategoryBrandDAO) {
        super.setBaseDAO(goodsCategoryBrandDAO);
        this.goodsCategoryBrandDAO = goodsCategoryBrandDAO;
    }

    @PostConstruct
    public void init() {
        super.init(GoodsCategoryBrandDO.class, GoodsCategoryBrandDTO.class);
    }

    @Override
    public int removeBrand(Long categoryId, List<Long> brandIds) {
        return goodsCategoryBrandDAO.removeBrand(categoryId, brandIds);
    }
}
